package com.mymail.entity;

import java.util.ArrayList;

import com.mymail.dao.FolderDAO;

public class Folder {
	//收件箱(A),发件箱(B),草稿箱(D),已发送(C),垃圾箱(E),自定义文件夹(F)
	public static final char SJX='A';
	public static final char FJX='B';
	public static final char YFS='C';
	public static final char CGX='D';
	public static final char LJX='E';
	public static final char ZDY='F';
	
	private Integer id;
	private String name;
	private Integer user;
	private char sort;
	private String other;
	//private static FolderDAO dao=new FolderDAO();
	
	public static FolderDAO getDAO(){
		return new FolderDAO();
	}
	
	public int getCount(){
		return getDAO().getCount(getId());
	}
	
	@SuppressWarnings("unchecked")
	public ArrayList<Mail> getMails(int start,int end){
		return Mail.getDAO().findMailsByFolderId(getId(), start, end);
	}
	
	public void addMail(Mail mail){		
	}
	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the user
	 */
	public Integer getUser() {
		return user;
	}
	/**
	 * @param user the user to set
	 */
	public void setUser(Integer user) {
		this.user = user;
	}
	/**
	 * @return the sort
	 */
	public char getSort() {
		return sort;
	}
	/**
	 * @param sort the sort to set
	 */
	public void setSort(char sort) {
		this.sort = sort;
	}
	/**
	 * @return the other
	 */
	public String getOther() {
		return other;
	}
	/**
	 * @param other the other to set
	 */
	public void setOther(String other) {
		this.other = other;
	}
	
	

}
